import React, { useState } from 'react';
import { Text, View, TouchableHighlight } from 'react-native';
import { scaleSizeH, scaleSizeW, setSpText } from '../../util/ScreenUtil.js'

export default function FilmsHeader(props) {
    let { children } = props
    let time=new Date(children)
    let month=time.getMonth()+1;
    let date=time.getDate();
    let Day=time.getDay()
    
    getDay(Day);
    let timeData=month+"月"+date+"日，"+Day
    function getDay(day) {
        switch (day) {
            case 1:
                Day="星期一"
                break;
            case 2:
                Day="星期二"
                break;
            case 3:
                Day="星期三"
                break;
            case 4:
                Day="星期四"
                break;
            case 5:
                Day="星期五"
                break;
            case 6:
                Day="星期六"
                break;
            case 0:
                Day="星期日"
                break;
        }
    }
    return (
        <View style={{width:scaleSizeW(750),height:scaleSizeH(74),borderBottomColor:"#f0f0f0",borderBottomWidth:1,backgroundColor:"#f7f7f7",justifyContent:"center"}}>
                <Text style={{fontSize:setSpText(24),color:"#989898",marginLeft:scaleSizeW(36)}}>{timeData}</Text>
        </View>
    );
}